#ifndef ShowkeyController_H
#define ShowkeyController_H

#include "showkeyWindow.h"
#include "showkeyGetkey.h"
#include "utils/desktopinfo.h"
#include <QObject>
#include <QTimer>
#include <QThread>
#include <QCheckBox>
#include <QDBusInterface>

class ShowkeyController : public QObject
{ 
    Q_OBJECT
public:
    explicit ShowkeyController(const QRect &rect, QWidget *parent);
    virtual ~ShowkeyController();

    bool eventFilter(QObject *obj, QEvent *e);
    void showkeyReadKey(bool checked );
public slots:
    void showScreenkeyWindow(QString value);
private slots:
    void hideScreenkeyWindow();
    void finished();
    void refreshLineShow();

private:
    QThread *pThread;
    ShowkeyGetkey *xev;
    QTimer *m_screenkeyTimer;
    QTimer *m_lineShowTimer;
    ShowkeyWindow *m_showkeyWindow;
    bool m_bChecked;
    DesktopInfo m_info;
    QDBusInterface *m_dbus_effect = nullptr;
    QDBusInterface *m_dbus_showkey = nullptr;
    QRect showkeyRect;

};
#endif
